chrome.extension.sendRequest({
	action: "getRequest",
	data: {
		url: "http://diarynote.jp/m/home/portal/index/",
		data: null
	}
}, function (response) {
	if (!response) {
		return;
	}
	var history = {};
	for (var elem = $(response).find(":contains('ｺﾒﾝﾄした日記')").next(); elem.text() != "ﾆｭｰｽの感想"; elem = elem.next()) {
		var url = elem.find("a").attr("href");
		if (url) {
			url = url.replace("/m/", "/").replace("?guid=ON", "");
			var text = $("<div/>").text(elem.text()).html(); // XSS対策
			history[url] = text;
		}
	}
	$("#profile").next().after("<div id='comment_history' class='box'><h3>コメント履歴</h3><ul></ul></div>");
	$("#comment_history > ul").append(function () {
		var content = "";
		for (var url in history) {
			content += "<li><a href='" + url + "'>" + history[url] + "</a></li>";
		}
		return content;
	});
});